import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/index"
  },
  {
    path: '/index',
    name: 'index',
    component: () => import(/* webpackChunkName: "index" */ '../views/index.vue'),
    children:[
      {
        path: '/index',
        redirect: "/index/home",
      },
      {
        path:'/index/home',
        name:"Home",
        component: () => import(/* webpackChunkName: "Home" */ '../views/Index/Home'),
      },
      {
        path:'/index/list',
        name:"List",
        component: () => import(/* webpackChunkName: "List" */ '../views/Index/List'),
      },
      {
        path:'/index/find',
        name:"Find",
        component: () => import(/* webpackChunkName: "Find" */ '../views/Index/Find'),
      },
      {
        path:'/index/shopping',
        name:"Shopping",
        component: () => import(/* webpackChunkName: "Shopping" */ '../views/Index/Shopping'),
      },
      {
        path:'/index/my',
        name:"My",
        component: () => import(/* webpackChunkName: "my" */ '../views/Index/My'),
      }
    ],
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import(/* webpackChunkName: "Detail" */ '../views/Detail/index.vue'),
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
